#include <iostream>

using namespace std;

int n;
int gcd(int a, int b)
{
	return b == 0 ? a : gcd(b, a % b);
}

int main()
{
	cin >> n;
	int ret; cin >> ret; ret = abs(ret);
	for (int i = 1; i < n; i++)
	{
		int x; cin >> x;
		ret = gcd(ret, abs(x));
	}

	cout << ret << endl;
	return 0;
}